#ifndef _RK3588_PREPROCESS_H_
#define _RK3588_PREPROCESS_H_

#include <opencv2/opencv.hpp>
#include "utils/common.h"
#include "postprocess.h"

class Preprocess
{
public:
    Preprocess(int width, int height, int target_size);
    ~Preprocess();
    std::unique_ptr<cv::Mat> Convert(const cv::Mat &src);
    const letterbox_t &get_letter_box();
    void ImagePostProcess(cv::Mat &image, object_detect_result_list &od_results);

private:
    double scale_;
    int padding_x_;
    int padding_y_;
    cv::Size new_size_;
    int target_size_;
    letterbox_t letterbox_;

    void ProcessDetectionImage(cv::Mat &image,
                               object_detect_result_list &od_results) const;
};

#endif // _RK3588_PREPROCESS_H_